from base.mybase import Tools

class reg_model(Tools):

    # 定义路径
    path = '/user/register'

    # 发送注册请求
    def reg_action(self,usr,pwd,cpwd,email,check='1234'):
        mydata = {
            "username": usr,
            "password": pwd,
            "cpassword": cpwd,
            "checkcode": check,
            "email": email
        }
        res = self.huihua.post(url=self.hosturl+self.path,data=mydata)
        # self.img()  # 调用截图
        return res.json()


import requests
s = requests.session()
reg = reg_model(huihua=s)
msg = reg.reg_action(usr='ueuquu1342',pwd='afhahfhai34',cpwd='afhahfhai34',email='ueuquu3421@qq.com')
print(msg)
